﻿<Window x:Class="SimCityPak.Views.ViewLotEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:helixToolKit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
             xmlns:scp="clr-namespace:SimCityPak"
             xmlns:simCityPak="clr-namespace:SimCityPak"
             xmlns:lotEditor="clr-namespace:SimCityPak.Views.AdvancedEditors.LotEditor"
             mc:Ignorable="d" 
             Height="700" Width="1054" Title="Advanced Editor">
    <Window.Resources>
        <ResourceDictionary Source="/Styles/LotEditorResourceDictionary.xaml" />
    </Window.Resources>
    <Grid Name="ContainerGrid" >
        <Grid.RowDefinitions>
            <RowDefinition Height="42" />
            <RowDefinition Height="619*" />
        </Grid.RowDefinitions>
       <Grid Grid.Row="1">
            <Grid.Resources>
                <scp:ColorToBrushConverter x:Key="BrushConverter" />
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="220" />
                <ColumnDefinition Width="651*" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>
            <Border Margin="6,12,0,166" Grid.Column="1">
                <helixToolKit:HelixViewport3D Name="viewPort" MouseUp="viewPort_MouseUp" KeyUp="viewPort_KeyUp">
                    <ModelVisual3D>
                        <ModelVisual3D.Content>
                            <DirectionalLight Direction="{Binding ElementName=viewPort, Path=Camera.LookDirection}" />
                        </ModelVisual3D.Content>
                    </ModelVisual3D>
                    <ModelVisual3D x:Name="VisualModelMain">
                        <ModelVisual3D.Content>
                            <Model3DGroup x:Name="geometryContent">
                               <GeometryModel3D x:Name="modelMain" >
                                    <GeometryModel3D.Material>
                                        <DiffuseMaterial Brush="DarkGray" />
                                    </GeometryModel3D.Material>
                                    <GeometryModel3D.Geometry>
                                        <MeshGeometry3D x:Name="meshMain" />
                                    </GeometryModel3D.Geometry>
                                </GeometryModel3D>
                            </Model3DGroup>
                        </ModelVisual3D.Content>
                    </ModelVisual3D>
                </helixToolKit:HelixViewport3D>
                <Border.Background>
                    <LinearGradientBrush EndPoint="1,0" StartPoint="1,0.8">
                        <GradientStop Color="DimGray" Offset="0" />
                        <GradientStop Color="Gray" Offset="1" />
                    </LinearGradientBrush>
                </Border.Background>
            </Border>
            <ContentControl Name="contentHolder" Grid.Column="1"  Height="160" VerticalAlignment="Bottom">
                <ContentControl.ContentTemplateSelector>
                    <simCityPak:LotEditorViewSelector />
                </ContentControl.ContentTemplateSelector>
                <ContentControl.Resources>
                    <DataTemplate  x:Key="viewLight">
                        <lotEditor:ViewUnitLight />
                    </DataTemplate>
                    <DataTemplate  x:Key="viewBinDraw">
                        <lotEditor:ViewUnitBinDrawSlot />
                    </DataTemplate>
                    <DataTemplate  x:Key="viewLightGroup">
                        <lotEditor:ViewUnitLightGroup />
                    </DataTemplate>
                    <DataTemplate  x:Key="viewDecal">
                        <lotEditor:ViewUnitDecal />
                    </DataTemplate>
                    <DataTemplate  x:Key="viewUnitEffect">
                        <lotEditor:ViewUnitEffect />
                    </DataTemplate>
                </ContentControl.Resources>
            </ContentControl>
            <TabControl Margin="0,12,0,0" Name="tabControl1" >
                <TabItem Name="tabLights">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_lightbulb.png" Stretch="None" Margin="3" />
                            <TextBlock>Lights</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid>
                        <DataGrid HorizontalGridLinesBrush="#FFA3A3A3" ItemsSource="{Binding UnitLights}" VerticalGridLinesBrush="#FFA3A3A3" AutoGenerateColumns="False" CanUserAddRows="False" Margin="6,57,6,345" Name="lbLights" SelectionChanged="lbLights_SelectionChanged" SelectionMode="Single" CanUserResizeRows="False" HeadersVisibility="Column">
                            <DataGrid.Columns>
                                <DataGridTextColumn Header="Name" Width="*" Binding="{Binding LightDebugName, Converter={simCityPak:StringPropertyConverter}}" />
                                <DataGridTemplateColumn>
                                    <DataGridTemplateColumn.CellTemplate>
                                        <DataTemplate>
                                            <Border Background="{Binding LightColor, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="16" Width="16" />
                                        </DataTemplate>
                                    </DataGridTemplateColumn.CellTemplate>
                                </DataGridTemplateColumn>
                            </DataGrid.Columns>
                        </DataGrid>
                        <Button Margin="6,6,0,0" Name="btnAddLight" VerticalAlignment="Top" HorizontalAlignment="Left" Click="btnAddLight_Click" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Add Light">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_lightbulb_add.png" Stretch="None" />
                        </Button>
                        <Button Margin="28,6,0,0" Name="btnCloneLight" VerticalAlignment="Top" HorizontalAlignment="Left" Click="btnCloneLight_Click" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Clone Light">
                            <Image Stretch="Uniform" Source="/SimCityPak;component/Images/LotEditor/16x16_lightbulb_copy.png" Height="16" />
                        </Button>
                        <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" HorizontalGridLinesBrush="#FFA3A3A3" Margin="6,0,6,6" Name="dgGroups" SelectionMode="Single" VerticalGridLinesBrush="#FFA3A3A3" VerticalAlignment="Bottom" SelectionChanged="dgGroups_SelectionChanged" GotFocus="dgGroups_GotFocus" Height="311">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding GroupContainer, StringFormat=X}" Header="ID" Width="*" IsReadOnly="True" />
                            </DataGrid.Columns>
                        </DataGrid>
                        <TextBlock HorizontalAlignment="Left" Margin="6,0,0,323" Text="Light Groups:" Height="16" VerticalAlignment="Bottom" />
                        <TextBlock Height="16" HorizontalAlignment="Left" Margin="6,36,0,0" Text="Lights:" VerticalAlignment="Top" />
                    </Grid>
                </TabItem>
                <TabItem  Name="tabDecals">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_image.png" Stretch="None" Margin="3" />
                            <TextBlock >Decals</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid >
                        <Button Margin="6,6,0,0" Name="btnAddDecal" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Add Decal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_image_add.png" Stretch="Uniform" Height="16" />
                        </Button>
                        <Button Margin="28,6,0,0" Name="btnCloneDecal" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{x:Null}" Click="btnCloneDecal_Click" BorderBrush="{x:Null}" ToolTip="Clone Decal">
                            <Image Stretch="Uniform" Source="/SimCityPak;component/Images/LotEditor/16x16_image_clone.png" Height="16" />
                        </Button>
                            <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" HorizontalGridLinesBrush="#FFA3A3A3" Margin="6,32,6,7" Name="dgDecals" SelectionMode="Single" VerticalGridLinesBrush="#FFA3A3A3" SelectionChanged="dgDecals_SelectionChanged" >
                                <DataGrid.Columns>
                                    <DataGridTextColumn Binding="{Binding ID, StringFormat=X}" Header="Decal ID" Width="*" />
                                </DataGrid.Columns>
                            </DataGrid>
                    </Grid>
                </TabItem>
                <TabItem  Name="tablSpawners">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_sim.png" Stretch="None" Margin="3" />
                            <TextBlock >Spawners</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid >

                    </Grid>
                </TabItem>
                <TabItem  Name="tabTransforms" IsSelected="True">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_transform_move.png" Stretch="None" Margin="3" />
                            <TextBlock >Transforms</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid >
                        <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserResizeRows="False" HorizontalGridLinesBrush="#FFA3A3A3" Margin="6,41,6,35" Name="dgTransforms" SelectionMode="Single" VerticalGridLinesBrush="#FFA3A3A3"  IsReadOnly="True" >
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding ID, StringFormat=X}" Header="Transform ID" Width="*" />
                            </DataGrid.Columns>
                        </DataGrid>
                        <Button Content="Clone" Height="23" HorizontalAlignment="Left" Margin="6,0,0,6" Name="btnCloneTransform" VerticalAlignment="Bottom" Width="178" Click="btnCloneLight_Click" />
                    </Grid>

                </TabItem>
                <TabItem Name="tabEffects">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_lightning.png" Stretch="None" Margin="3" />
                            <TextBlock >Effects</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid>
                        <Button Margin="6,6,0,0" Name="btnAddEffect" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Add Effect">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_lightning_add.png" Stretch="None" />
                        </Button>
                        <Button Margin="28,6,0,0" Name="btnCloneEffect" VerticalAlignment="Top" HorizontalAlignment="Left"  Click="btnCloneEffect_Click"  Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Clone Effect">
                            <Image Stretch="Uniform" Source="/SimCityPak;component/Images/LotEditor/16x16_lightning_clone.png" Height="16"  />
                        </Button>
                        <DataGrid AutoGenerateColumns="False" CanUserAddRows="False" ItemsSource="{Binding UnitEffects}" CanUserResizeRows="False" HorizontalGridLinesBrush="#FFA3A3A3" Margin="6,32,6,7" Name="dgEffects" SelectionMode="Single" VerticalGridLinesBrush="#FFA3A3A3" IsReadOnly="True" SelectionChanged="dgEffects_SelectionChanged">
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding ID, Converter={simCityPak:KeyPropertyConverter}}" Header="ID" Width="*" />
                            </DataGrid.Columns>
                        </DataGrid>
                        
                    </Grid>
                </TabItem>
                <TabItem Name="tabLot" IsSelected="True">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_lot.png" Stretch="None" Margin="3" />
                            <TextBlock>Lot</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid>
                        <GroupBox Header="Lot Surface" Height="139" HorizontalAlignment="Left" Margin="6,95,0,0" VerticalAlignment="Top" Width="202">
                            <Grid>
                                <Border Background="{Binding LotColor1, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,10,0,0" Name="rectangle1" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" Text="Color 1:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,10,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotColor2, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,36,0,0" Name="border1" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,36,0,0" Text="Color 2:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,36,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotColor3, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,62,0,0" Name="border2" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,62,0,0" Text="Color 3:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,62,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotColor4, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,88,0,0" Name="border3" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,88,0,0" Text="Color 4:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,88,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,10,0,0" Name="cbbGroundTexture1" SelectedValue="{Binding LotColor1Texture}" VerticalAlignment="Top" Width="44" Style="{StaticResource StyleGroundTextureCombobox}" >
                                </ComboBox>
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,36,0,0" Name="cbbGroundTexture2" SelectedValue="{Binding LotColor2Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,62,0,0" Name="cbbGroundTexture3" SelectedValue="{Binding LotColor3Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,88,0,0" Name="cbbGroundTexture4" SelectedValue="{Binding LotColor4Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                            </Grid>
                        </GroupBox>
                        <GroupBox Header="Lot Borders" Height="139" HorizontalAlignment="Left" Margin="6,237,0,0" VerticalAlignment="Top" Width="202">
                            <Grid>
                                <Border Background="{Binding LotBorderColor1, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,10,0,0" Name="border4" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" Text="Color 1:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,10,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotBorderColor2, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,36,0,0" Name="border5" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,36,0,0" Text="Color 2:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,36,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotBorderColor3, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,62,0,0" Name="border6" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,62,0,0" Text="Color 3:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,62,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <Border Background="{Binding LotBorderColor4, Converter={simCityPak:ColorPropertyConverter}}" BorderBrush="Black" BorderThickness="1" Height="20" HorizontalAlignment="Left" Margin="61,88,0,0" Name="border7" SnapsToDevicePixels="True" VerticalAlignment="Top" Width="42" />
                                <TextBlock HorizontalAlignment="Left" Margin="10,88,0,0" Text="Color 4:" VerticalAlignment="Top" />
                                <Button Height="16" HorizontalAlignment="Left" Margin="109,88,0,0" VerticalAlignment="Top">
                                    <Button.Template>
                                        <ControlTemplate>
                                            <Image Cursor="Hand" Height="16" Source="/SimCityPak;component/Images/edit.png" Width="16" />
                                        </ControlTemplate>
                                    </Button.Template>
                                </Button>
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,10,0,0"  SelectedValue="{Binding LotBorderColor1Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,36,0,0"  SelectedValue="{Binding LotBorderColor2Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,62,0,0"  SelectedValue="{Binding LotBorderColor3Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                                <ComboBox Height="20" HorizontalAlignment="Left" Margin="132,88,0,0"  SelectedValue="{Binding LotBorderColor4Texture}" Style="{StaticResource StyleGroundTextureCombobox}" VerticalAlignment="Top" Width="44" />
                            </Grid>
                        </GroupBox>
                        <TextBlock HorizontalAlignment="Left" Margin="6,38,0,0" Text="Lot Mask" VerticalAlignment="Top" />
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="88,37,0,0" Text="{Binding LotMask, Converter={simCityPak:KeyPropertyConverter}}" VerticalAlignment="Top" Width="120" />
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="88,8,0,0" Text="{Binding LotSizeX}" VerticalAlignment="Top" Width="61" />
                        <TextBox Height="23" HorizontalAlignment="Left" Margin="153,8,0,0" Text="{Binding LotSizeY}" VerticalAlignment="Top" Width="55" />
                        <TextBlock HorizontalAlignment="Left" Margin="6,9,0,0" Text="Lot Size" VerticalAlignment="Top" />
                        <Button Content="Import Lot Texture" Height="23" HorizontalAlignment="Left" Margin="6,66,0,0" Name="btnImportLotTexture" VerticalAlignment="Top" Width="201" Click="btnImportLotTexture_Click" />
                    </Grid>
                </TabItem>
                <TabItem Name="tabProps" IsSelected="True">
                    <TabItem.Header>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_box.png" Stretch="None" Margin="3" />
                            <TextBlock>Props</TextBlock>
                        </StackPanel>
                    </TabItem.Header>
                    <Grid>
                        <Button Margin="6,6,0,0" Name="btnAddProp" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Add Prop">
                            <Image Source="/SimCityPak;component/Images/LotEditor/16x16_box_add.png" Stretch="Uniform" Height="16" />
                        </Button>
                        <Button Margin="28,6,0,0" Name="btnCloneProp" VerticalAlignment="Top" HorizontalAlignment="Left" Background="{x:Null}" BorderBrush="{x:Null}" ToolTip="Clone Prop" Click="btnClone_Click">
                            <Image Stretch="Uniform" Source="/SimCityPak;component/Images/LotEditor/16x16_box_clone.png" Height="16" />
                        </Button>
                        <DataGrid AutoGenerateColumns="False" ItemsSource="{Binding UnitBinDrawSlotList}" CanUserAddRows="False" CanUserResizeRows="False" HorizontalGridLinesBrush="#FFA3A3A3" Margin="6,30,6,6" Name="dgProps" SelectionMode="Single" VerticalGridLinesBrush="#FFA3A3A3" SelectionChanged="dgProps_SelectionChanged">
                            <DataGrid.GroupStyle>
                                <GroupStyle>
                                    <GroupStyle.HeaderTemplate>
                                        <DataTemplate>
                                            <TextBlock Margin="3" Text="{Binding Path=Name}" />
                                        </DataTemplate>
                                    </GroupStyle.HeaderTemplate>
                                </GroupStyle>
                            </DataGrid.GroupStyle>
                            <DataGrid.Columns>
                                <DataGridTextColumn Binding="{Binding Index}" Header="Index" Width="*" IsReadOnly="True" />
                                <DataGridTextColumn Binding="{Binding Slot.Value}" Header="Slot" Width="*" IsReadOnly="True" />
                            </DataGrid.Columns>
                        </DataGrid>
                    </Grid>
                </TabItem>
            </TabControl>
            <Button Content="Save" Height="23" Name="btnSave" Width="75" Grid.Column="1" Margin="0,0,10,10" VerticalAlignment="Bottom" HorizontalAlignment="Right" Click="btnSave_Click" />
            <Grid Grid.Column="2">
                <Grid.RowDefinitions>
                    <RowDefinition Height="357*" />
                    <RowDefinition Height="262*" />
                </Grid.RowDefinitions>
                <TabControl Name="tabControl2" Margin="0,12,0,0">
                    <TabItem Header="Visibility" Name="tabDisplay">
                        <Grid>
                            <CheckBox VerticalAlignment="Top" HorizontalAlignment="Left" Margin="71,33,0,0" Style="{StaticResource styleCustomCheckBox}" IsChecked="True" Name="chkEffects" Click="CheckBoxEffects_Checked" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,33,0,0" Text="Effects" VerticalAlignment="Top" />
                            <CheckBox VerticalAlignment="Top" HorizontalAlignment="Left" Margin="71,55,0,0" Style="{StaticResource styleCustomCheckBox}" IsChecked="True"  Name="chkLights" Click="CheckBox_Checked" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,55,0,0" Text="Lights" VerticalAlignment="Top" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,77,0,0" Text="Props" VerticalAlignment="Top" />
                            <CheckBox HorizontalAlignment="Left" Click="CheckBoxProps_Checked" IsChecked="True" Name="checkBoxProps" Margin="71,77,0,0" Style="{StaticResource styleCustomCheckBox}" VerticalAlignment="Top" />
                            <CheckBox HorizontalAlignment="Left" Margin="71,99,0,0"  Style="{StaticResource styleCustomCheckBox}" VerticalAlignment="Top" IsChecked="True"  Name="CheckBoxDecals" Click="CheckBoxDecals_Checked" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,99,0,0" Text="Decals" VerticalAlignment="Top" />
                            <CheckBox HorizontalAlignment="Left"  Margin="71,121,0,0" Name="chkSpawners" IsChecked="True" Click="chkSpawners_Click" Style="{StaticResource styleCustomCheckBox}" VerticalAlignment="Top" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,121,0,0" Text="Spawners" VerticalAlignment="Top" />
                            <CheckBox HorizontalAlignment="Left" IsChecked="True" Margin="71,6,0,0" Name="chkModel" Click="chkModel_Click" Style="{StaticResource styleCustomCheckBox}" VerticalAlignment="Top" />
                            <TextBlock HorizontalAlignment="Left" Margin="6,6,0,0" Text="Unit Model" VerticalAlignment="Top" />
                        </Grid>
                    </TabItem>
                </TabControl>
            </Grid>
        </Grid>
    </Grid>
</Window>
